#ifndef EDITDEPT_H
#define EDITDEPT_H

#include "Entity/DictData.h"
#include "api/systemManager/deptmanagerapi.h"
#include <QDialog>

namespace Ui {
class EditDept;
}

class EditDept : public QDialog
{
    Q_OBJECT

public:
    explicit EditDept(QList<DictData> sys_normal_disable,int deptId = 0,QString parentName = "",
                      int parentId = -1,QWidget *parent = nullptr);
    ~EditDept();

signals:
    void success();

protected:
    bool eventFilter(QObject *obj, QEvent *event);

private slots:
    void on_btn_cancel_clicked();

    void on_btn_ok_clicked();

private:
    Ui::EditDept *ui;
    QList<DictData> sys_normal_disable;
    QTreeWidget *tree;
    DeptManagerApi api;
    QList<Dept> deptList;
    Utils utils;
    Dept dept;
    int deptId;
    // bool flag;

    void init();
    void getList();
    void initTree();
    void setChildTree(QTreeWidgetItem *item);
};

#endif // EDITDEPT_H
